]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
switcherPopup: Use this._highlighted to check for reentrancy
authorJonas Dreßler <verdre@v0yd.nl>
Wed, 25 Apr 2018 20:14:57 +0000 (22:14 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Wed, 26 Feb 2020 22:46:51 +0000 (22:46 +0000)
Since this._highlighted is always set to the currently highlighted
index, there's no need to save the index to a separate variable. This
obviously depends on getting the new item highlighted as a result of the
item-entered event.

This fixes bugs in situations where the highlighted element changes
after an event that is not calling _onItemEnter, for example after
scrolling or pressing a key. In those cases the _currentItemEntered
variable wouldn't be updated and the old item couldn't be entered
anymore without entering another one before.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/167

js/ui/switcherPopup.js

index d1322106e33479a24ba686b1dca2a6e4c4b3ea9a..d026453ca3cf47bf6233dcd4afc2b5db9232da48 100644 (file)
@@ -440,10 +440,9 @@ var SwitcherList = GObject.registerClass({
 
     _onItemEnter(index) {
         // Avoid reentrancy
-        if (index != this._currentItemEntered) {
-            this._currentItemEntered = index;
+        if (index !== this._highlighted)
             this._itemEntered(index);
-        }
+
         return Clutter.EVENT_PROPAGATE;
     }